#include("../layout.html")
#@layout("用户")

#define body()
<h1 class="wp-heading-inline">用户</h1>
<a href="/admin/user/create" class="page-title-action">添加用户</a>
#if(q)
<span class="subtitle">“#(q)”的搜索结果</span>
#end
<hr class="wp-header-end">

<div class="layui-fluid">
	<h2 class="screen-reader-text">过滤文章列表</h2>
	<ul class="subsubsub">
		<li class="all"><a href="" class="current" aria-current="page">全部<span class="count">（2）</span></a> |</li>
		<li class="draft"><a href="">管理员<span class="count">（1）</span></a></li>
	</ul>
	
	<form id="posts-filter" class="layui-form">
		<div class="search-box">
			<label class="screen-reader-text" for="post-search-input">搜索文章:</label>
			<div class="layui-inline">
				<input type="search" id="post-search-input" name="q" value="#(q??)" class="layui-input">
			</div>
			<div class="layui-inline">
				<input type="submit" id="search-submit" class="layui-btn layui-btn-sm layui-btn-primary" value="搜索用户">
			</div>
		</div>
		<div class="tablenav top">
			<div class="alignleft actions bulkactions">
				<label for="bulk-action-selector-top" class="screen-reader-text">选择批量操作</label>
				<div class="layui-inline">
					<select name="action" id="bulk-action-selector-top">
						<option value="-1">批量操作</option>
						<option value="trash">删除</option>
					</select>
				</div>
				<div class="layui-inline">
					<input type="submit" id="doaction" class="layui-btn layui-btn-sm layui-btn-primary" value="应用">
				</div>
			</div>
			<div class="alignleft actions">
				<label class="screen-reader-text" for="cat">按分类过滤</label>
				<div class="layui-inline">
					<select name="new_role2" id="new_role2">
						<option value="">将角色变更为…</option>
						<option value="subscriber">订阅者</option>
						<option value="contributor">投稿者</option>
						<option value="author">作者</option>
						<option value="editor">编辑</option>
						<option value="administrator">管理员</option>		
					</select>
				</div>
				<div class="layui-inline">
					<input type="submit" name="filter_action" id="post-query-submit" class="layui-btn layui-btn-sm layui-btn-primary" value="更改">	
				</div>	
			</div>
			<div class="tablenav-pages"></div>
			<br class="layui-clear">
		</div>
		
		<h2 class="screen-reader-text">文章列表</h2>
		<table class="layui-table" lay-skin="line" lay-even>
		  	<colgroup>
		  		<col width="30">
		    	<col>
		    	<col>
		    	<col>
		    	<col width="180">
		    	<col width="75">
		  	</colgroup>
		  	<thead>
		    	<tr align="left">
		    		<th><input type="checkbox" name="" lay-skin="primary"></th>
		      		<th>用户名</th>
		      		<th>姓名</th>
		      		<th>电子邮件</th>
		      		<th>角色</th>
		      		<th align="center" style="text-align:center;">文章</th>
		    	</tr> 
		  	</thead>
		  	<tbody>
		  		
		  	</tbody>
		  	#[[
		  		<script id="user-page-tpl" type="text/xml">
				{{# layui.each(d, function(index, item){ }}
		    	<tr align="left">
		    		<td><input type="checkbox" name="" lay-skin="primary"></td>
		      		<td class="username column-username has-row-actions column-primary">
		      			<img alt="" src="" class="avatar avatar-32 photo" height="32" width="32">
		      			<strong>{{item.user_login}}</strong>
		      			<div class="row-actions">
		      				<span class="edit"><a href="/admin/user/edit?user_id={{item.ID}}" aria-label="编辑“(无标题)”">编辑</a> | </span>
		      				<span class="view"><a href="" rel="bookmark" aria-label="预览“(无标题)”">查看</a></span>
		      			</div>
		      		</td>
		      		<td>
		      			<span>—</span>
		      			<span class="screen-reader-text">未知</span>
		      		</td>
		      		<td>
		      			<a href="mailto:{{item.user_email}}">{{item.user_email}}</a>
		      		</td>
		      		<td>
		      			{{# if(item.role == 'subscriber'){ }}
						订阅者
						{{# } }}
						{{# if(item.role == 'contributor'){ }}
						投稿者
						{{# } }}
						{{# if(item.role == 'author'){ }}
						作者
						{{# } }}
						{{# if(item.role == 'editor'){ }}
						编辑
						{{# } }}
						{{# if(item.role == 'administrator'){ }}
						管理员
						{{# } }}
					</td>
		      		<td align="center">
		      			<a href="/admin/post?author=1" class="edit">
							<span>1</span>
							<span class="screen-reader-text">此作者有1篇文章</span>
						</a>
		      		</td>
		    	</tr>
				{{# }); }}
		    	</script>
			]]#
		  	<tfoot>
		    	<tr align="left">
		    		<th><input type="checkbox" name="" lay-skin="primary"></th>
		      		<th>用户名</th>
		      		<th>姓名</th>
		      		<th>电子邮件</th>
		      		<th>角色</th>
		      		<th align="center" style="text-align:center;">文章</th>
		    	</tr> 
		  	</tfoot>
		</table>
		
		<div class="tablenav bottom">
			<div class="alignleft actions bulkactions">
				<label for="bulk-action-selector-bottom" class="screen-reader-text">选择批量操作</label>
				<div class="layui-inline">
					<select name="action2" id="bulk-action-selector-bottom">
						<option value="-1">批量操作</option>
						<option value="trash">删除</option>
					</select>
				</div>
				<div class="layui-inline">
					<input type="submit" id="doaction2" class="layui-btn layui-btn-sm layui-btn-primary" value="应用">
				</div>
			</div>
			<div class="alignleft actions">
				<label class="screen-reader-text" for="cat">按分类过滤</label>
				<div class="layui-inline">
					<select name="new_role2" id="new_role2">
						<option value="">将角色变更为…</option>
						<option value="subscriber">订阅者</option>
						<option value="contributor">投稿者</option>
						<option value="author">作者</option>
						<option value="editor">编辑</option>
						<option value="administrator">管理员</option>		
					</select>
				</div>
				<div class="layui-inline">
					<input type="submit" name="filter_action" id="post-query-submit" class="layui-btn layui-btn-sm layui-btn-primary" value="更改">	
				</div>
			</div>
			<div class="tablenav-pages"></div>
			<br class="layui-clear">
		</div>
	</form>
</div>
#end

#define foot()
<script>
layui.cache.page = 'user';
</script>
#end